<!-- amline script-->
  <script type="text/javascript" src="{{ amline_path }}swfobject.js"></script>
	<div id="flashcontent">
		<strong>Waiting to load the Flash object via Javascript.</strong>

	</div>

	<script type="text/javascript">
		// <![CDATA[		
		var so = new SWFObject("{{ amline_path }}amline.swf", "amline", "720", "500", "8", "#FFFFFF");
		so.addVariable("path", "{{ amline_path }}");
		
		{% spaceless %}
  	   
	   so.addVariable("chart_data", encodeURIComponent("<chart>
      <series>
      
      {% for t in all_times %} 
      	<value xid='{{ forloop.counter }}'>{{ t|date:"Y-m-d H:i" }}</value>
      {% endfor %}
      
      </series>
       
      <graphs>
      	{% for tuple in stats_table.iteritems %}
      	<graph gid='{{ forloop.counter }}' title='{{ tuple.0.name }}'>
        	{% for v in tuple.1 %}
        	  {% ifnotequal v None %}
                <value xid='{{ forloop.counter }}'>{{ v }}</value>
              {% endifnotequal %}
            {% endfor %}
        </graph>
        {% endfor %}
       
       </graphs></chart>") );
  	    
  	    {% endspaceless %}
  	    
  	    {% spaceless %}
        so.addVariable("chart_settings", encodeURIComponent("<settings>
        	<background><color>#FFFFFF,#FF9E01</color><alpha>100</alpha></background>
        	<labels>
        	<label><y>24</y><width>720</width><align>center</align>
        	<text><![CDATA[<b>{{ metric_set.description }}</b>]]></text>
        	</label>
        	</labels>
        	<decimals_separator>.</decimals_separator>
        	<precision>0</precision>
        	<values><y_left><integers_only>true</integers_only><min>0</min></y_left></values>
        	</settings>"));
        {% endspaceless %}
        
		so.write("flashcontent");
		// ]]>
	</script>
<!-- end of amline script -->
